var xhr = null;

function createXHR() {
	if (window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
	} else
		xhr = null;
	return xhr;
}

function stateChanged() {
	if (xhr.readyState == 4) {
		if (xhr.status == 200) {
			document.getElementById("showPanel").innerHTML = xhr.responseText;
		} else {
			alert(xhr.status);
		}
	}
}

function checkAccount() {
	xhr = createXHR();
	if (xhr == null) {
		alert("Does not support Ajax....");
		return;
	}
	xhr.onreadystatechange = stateChanged;
	var url = "/WA102G2_all_in_one/member/mem.do?action=checkAccount&account="
			+ document.getElementById("acc").value;
	
	xhr.open("get", url, false);
	xhr.send(null);
}

function stateChanged2() {
	if (xhr.readyState == 4) {
		if (xhr.status == 200) {
			document.getElementById("showPanel2").innerHTML = xhr.responseText;
		} else {
			alert(xhr.status);
		}
	}
}

function checkNickname() {
	xhr = createXHR();
	if (xhr == null) {
		alert("Does not support Ajax....");
		return;
	}
	xhr.onreadystatechange = stateChanged2;
	var url = "/WA102G2_all_in_one/member/mem.do?action=checkNickname&nickname="
			+ document.getElementById("nick").value;
	
	xhr.open("get", url, false);
	xhr.send(null);
}